<!-- 列表组件 -->
<template>
<div class="item-list">
    <div class="item" v-for='(item,index) in itemList' :key='index' @click='itemClick(index)'>
        <div class="left">
            <div class="time">{{item.time}}</div>
            <div class="message">
            {{item.message}}
            </div>
        </div>
        <div class="right">
            <p v-for='(rightText,index) in item.right' :key='index'>{{rightText}}</p>
        </div>
    </div>
</div>
</template>

<script>
export default {
  props: ['itemList'],
  components: {},
  data () {
    return {
    }
  },
  mounted () {

  },
  computed: {},
  methods: {
    itemClick (index) {
      this.$EventBus.$emit('itemListClick', index)
    }
  }
}

</script>
<style lang='less' scoped>
.item {
    width: 100%;
    overflow: hidden;
    background-color: #fff;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    font-size: 14px;
    color: #3f3f3f;
    -webkit-box-shadow: 0 1px 2px #ccc;
    box-shadow: 0 1px 2px #ccc;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: justify;
    justify-content: space-between;
    padding: 8px 12px;
}
.item .left .time {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 8px;
}
.item .left .message {
    font-size: 14px;
    color: #333;
}
.item .right p {
    font-size: 12px;
}
.item .right p:first-child {
    font-size: 16px;
    margin-bottom: 6px;
}
.item .right {
    text-align: right;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-pack: center;
    justify-content: center;
}
</style>
